#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<queue>
#include<set>
using namespace std;
class Solution {
public:
    vector<int> getSubarrayBeauty(vector<int>& nums, int k, int x) {
        vector<int> result;
        priority_queue<int, vector<int>, greater<int>> q;
        for (int i = 0; i <= nums.size() - k; i++)
        {
            int tmp = k;
            while (tmp--)
            {
                q.push(nums[i + tmp - 1]);
            }
            int tmpp = x - 1;
            while (tmpp--)
            {
                q.pop();
            }
            if (q.top() < 0)
            {
                result.push_back(q.top());
            }
            while (q.size())
            {
                q.pop();
            }
        }
        return result;
    }
};int main()
{
    Solution test;
    vector<int> data({ 1,-1,-3,-2,3 });
    test.getSubarrayBeauty(data, 3, 2);
	return 0;
}
class solution {
public:
    vector<int> findAnagrams(string s, string p) {
        vector<int> result;
        for (int i = 0; i <= s.size() - p.size(); i++)
        {
            int sign = 1;
            int left = i;
            int right = left + p.size() - 1;
            set<char>  data;
            while (left <= right)
            {
                data.insert(s[left]);
                left++;
            }
            int tmp = p.size();
            while (tmp)
            {
                if (data.count(p[tmp - 1]))
                {
                    sign = 0;
                    break;
                }
                tmp--;
            }
            if (sign == 1)
            {
                result.push_back(i);
            }
        }
    }
};